<?php
namespace app\demo\controller;

use app\BaseController;
use app\model\Demo;

class M extends BaseController{
	public function index(){
		$categoryId = $this->request->param("catagory_Id",0,"intval");
		//echo "1";exit($categoryId);
		if(empty($categoryId)){
			return show(config("status.error"),"参数为空");
		}

		//
		$model = new Demo();
		$results =$model->where("category_id",$categoryId)
				->limit(10)
				->order("id","desc")
				->select();

		return show(config("status.success"),"ok",$results);
	}
}